﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Pku.BookStore.IServices;
using Pku.BookStore.Model;

namespace Pku.BookStore.Services
{
    [Serializable]
    [ServiceBehavior(IncludeExceptionDetailInFaults = true, ConcurrencyMode = ConcurrencyMode.Multiple)]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class OrderFormServices : IOrderFormServices
    {
        /// <summary>
        /// 获取实例名
        /// </summary>
        private DAL.OrderFormDAL orderFormDAL
        {
            get
            {
                return new DAL.OrderFormDAL();
            }
        }

        /// <summary>
        /// 增加订单
        /// </summary>
        /// <param name="entity"></param>
        public int Add(OrderFormModel entity)
        {
            return orderFormDAL.Add(entity);
        }

        /// <summary>
        /// 修改订单
        /// </summary>
        /// <param name="entity"></param>
        public bool Modify(OrderFormModel entity)
        {
            return orderFormDAL.Modify(entity);
        }

        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        public List<OrderFormModel> Search(OrderFormParam param)
        {
            return orderFormDAL.Search(param);
        }

        /// <summary>
        /// 获取总数
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public int GetCount(Model.OrderFormParam param)
        {
            return orderFormDAL.GetCount(param);
        }

        /// <summary>
        /// 获取订单实体
        /// </summary>
        /// <param name="orderID"></param>
        /// <returns></returns>
        public OrderFormModel GetEntityById(int orderID)
        {
            return orderFormDAL.GetEntityById(orderID);
        }

        /// <summary>
        /// 修改订单状态
        /// </summary>
        /// <param name="entity"></param>
        public bool ModifyStatus(OrderFormModel entity)
        {
            return orderFormDAL.ModifyStatus(entity);
        }

        /// <summary>
        /// 修改订单状态
        /// </summary>
        /// <param name="entity"></param>
        public bool ModifyStatus(OrderFormModel entity, int UserID)
        {
            return orderFormDAL.ModifyStatus(entity, UserID);
        }

    }
}
